package com.yuyu.shop.api.controller.es;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuyu.shop.api.apimodel.order.es.ESOrderQueryDTO;
import com.yuyu.shop.domain.order.service.OrderDomainService;
import com.yuyu.shop.infrastructure.persistence.po.OrderPO;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * @author
 * @version 1.0
 * @description: order es操作
 * @date 2022/8/20 9:19
 */
@RequestMapping("/esOrder")
@RestController
@AllArgsConstructor(onConstructor = @_(@Autowired))
public class EsOrderController {

    private final OrderDomainService orderDomainService;

    @PostMapping("/esQueryOrder")
    public IPage<OrderPO> esQueryOrder(@NotNull @RequestBody ESOrderQueryDTO dto){
      return orderDomainService.queryESOrder(dto);
    }


}
